#include "ParticleVictoryKeepAll.h"

#include "ParticleContext.h"
#include "DescriptorParticle.h"

#include "VictoryConditions.h"

using namespace ParticleEngine;

const DescriptorParticle ParticleVictoryKeepAll::Descriptor
(
"VictoryKeepAll",
[](ParticleContext& NewContext){ return new ParticleVictoryKeepAll(NewContext); }
);

ParticleVictoryKeepAll::ParticleVictoryKeepAll(ParticleContext& NewContext) :
ParticleBase(NewContext, &ParticleVictoryKeepAll::Descriptor),
Active(false)
{
	Adhesions = new PropertyAdhesions(0.1f);
	Adhesions->ParticleCast = this;
}
ParticleVictoryKeepAll::~ParticleVictoryKeepAll(void)
{
}

ColorRGBA<unsigned char> ParticleVictoryKeepAll::GetColor()
{
	return ColorRGBA<unsigned char>(128, 128, 64, 255);
}

void ParticleVictoryKeepAll::Sole()//einzelne aktualisierzung
{
	this->SoleStandard();

	if (this->Active == false)
	{
		if (Adhesions->AdhesionCount < 6)
		{
			Active = true;
			Context.Victory.KeepAllReleased();
		}
	}
}